import 'package:car_map/mode/time_scale.dart';
import 'package:car_map/page/res/gaps.dart';
import 'package:car_map/widget/widget_notfound.dart';
import 'package:car_map/widget/widget_time_scale.dart';
import 'package:flutter/material.dart';

///点火统计
class IgnitionPage extends StatefulWidget{
  @override
  _ignitionState createState() =>_ignitionState();
}

class _ignitionState extends State<IgnitionPage>{

  List<TimeScale> timeList;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    getTimeScaleList();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text('点火统计'),
      ),
      body: Container(
        child: ListView(
          shrinkWrap: true,//内容适配
          children: <Widget>[
            TimeScaleWidget(
              timeScaleList: timeList,
            ),
            Gaps.vGap10,
            WidgetNotFound(),
          ],
        ),
      ),
    );
  }


  getTimeScaleList() {
    timeList = new List();
    timeList.add(new TimeScale(title: '今天', index: 0));
    timeList.add(new TimeScale(title: '三天', index: 1));
    timeList.add(new TimeScale(title: '近一周', index: 2));
    timeList.add(new TimeScale(title: '近一月', index: 3));
  }
}